
public class Main {
    public static void main(String[] args) {
        //懒汉式
        System.out.println("懒汉式");
        System.out.println(LazySingletonPatternCarFactory.getInstance().showHashCode());
        System.out.println(LazySingletonPatternCarFactory.getInstance().showHashCode());
        System.out.println(LazySingletonPatternCarFactory.getInstance().showHashCode());
        System.out.println("饿汉式");
        System.out.println(EagerLazySingletonPatternCarFactory.getInstance().showHashCode());
        System.out.println(EagerLazySingletonPatternCarFactory.getInstance().showHashCode());
        System.out.println(EagerLazySingletonPatternCarFactory.getInstance().showHashCode());

    }
}
